using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter13
{
	/// <summary>
	/// Example05: A Geosynchronous Satellite
	/// Consider a satellite of mass m moving in a 
	/// circular orbit around the Earth at a constant speed v 
	/// and at an altitude h above the Earth's surface, 
	/// as illustrated in Figure 13.9.
	/// (A) Determine the speed of the satellite in terms 
	/// of G, h, R_E ( the radius of the Earth), 
	/// and M_E (the mass of the Earth).
	/// v = \sqrt{GM_E/(R_E + h)}}
	/// (B) If the satellite is to be geosynchronous 
	/// (that is, appearing to remain over a fixed position 
	/// on the Earth), how fast is it moving through space?
	/// v = 3.07 \times 10^3 m/s
	/// </summary>
	public class Example05
	{
		public Example05()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			//(A) read the book.
			//(B)
			L.Length rph = new L.Length();
			rph.m = Math.Pow(L.Constant.AccelerationOfGravity
				*L.Earth.Radius*L.Earth.Radius
				*24.0*60.0*60.0*24.0*60.0*60.0
				/4.0/Math.PI/Math.PI,1.0/3.0);
			L.Velocity v = new L.Velocity();
			v.X = 2.0*Math.PI*rph.m/24.0/60.0/60.0;
			result+=Convert.ToString(v.mPERs);
		}
	}
}
